// 1.导入 axios
import axios from 'axios'

// 2.创建axios实例
//      2.1axios.create({config配置})  
const request = axios.create({
    // 配置公共的url
    baseURL:'http://localhost:8080',
    // 过期时间 3秒
    timeout:30000

})

// 3.  get 
export const reqGet = function(url,params){
    return request({
        url,
        method:'get',
        params
    })
}

// 4.post
export const reqPost = function(url,data,params){
    return request({
        url,
        method:'post',
        data,
        params
    })
}